package com.org;

import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.MessageConsumer;
import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;

import org.apache.activemq.ActiveMQConnectionFactory;

public class CT {
	public static void main(String[] args) throws Exception {
	ConnectionFactory  factory=new ActiveMQConnectionFactory("failover://tcp://127.0.0.1:61616");
	Connection con=factory.createConnection();
	con.start();
	Session session=con.createSession(false,Session.AUTO_ACKNOWLEDGE);
    Queue queue=session.createQueue("mao");
	MessageConsumer  consumer=session.createConsumer(queue);
	TextMessage message=(TextMessage)consumer.receive();
	System.out.println(message.getText()+".............ct");
	session.commit();
	con.stop();
	con.close();
}
}